package PTA.ch01;

import java.util.Scanner;

public class ex02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while(sc.hasNextLine()){
            String s = sc.nextLine();
            int a= Integer.parseInt(s);
            if(a>=10000&&a<=200000){
                System.out.println(Integer.toString(a,2)+","+Integer.toString(a,8)+","+Integer.toString(a,16));
            }else{
                int sum=0;
                for(int i=0;i<s.length();i++){
                    char c = s.charAt(i);
                    if(c!='-'){
                        int b=c-'0';
                        sum+=b;
                        System.out.print(c+" ");

                    }
                }
                System.out.println(sum);

            }
        }



    }
}
